const express = require('express');
const news = require('./news');
const bodyParser = require('body-parser');
const path = require('path');
const app = express();
const moment = require('moment');
app.locals.moment = moment;
app.set('views' , './templates');
app.set('view engine' , 'ejs');
app.use( bodyParser.urlencoded( {extended : false} ) );
app.use('/publish' , express.static(path.join(__dirname, 'publish')))
app.use(news);
app.listen(3031 , ()=>{
    console.log('运行成功！')
})